﻿@model yq.WebModel.Sys.DepartmentEidt
           
@using (Ajax.BeginForm("DoAddDepartment", new { }, new AjaxOptions { HttpMethod = "post", OnSuccess = "InitializeTips" }))
{ 
    @Html.HiddenFor(obj=>obj.SuperiorDep)
    <div>
        <table class="table table-condensed"  width="400px" style=" margin-bottom:0px ">
            <tbody>
                <tr>
                    <td>
                        @(Html.RawFor(obj => obj.Title))
                    </td>
                    <td>
                        @Html.TextBoxFor(obj => obj.Title)
                    </td>
                </tr>
                <tr>
                    <td>
                        @(Html.RawFor(obj => obj.SuperiorDep))
                    </td>
                    <td>
                      @Model.SuperiorDepName
                    </td>
                </tr>
                  <tr>
                    <td>
                       
                    </td>
                    <td>
                
                    </td>
                </tr>
                 <tr>
                    <td>
                       
                    </td>
                    <td>
                
                      @Html.Submit("保 存", new { id = "AddDepSubmit" })
                    </td>
                </tr>

            </tbody>
        </table>
    </div>
}
<script>

    function InitializeTips(obj) {
        if (obj.Status == 1) {
            $.tips("添加成功");
            getCurrentDialog($("#AddDepSubmit")).close();
        } else {
            $.tips(obj.ErrorText);
        }
    }

</script>
